<template>
  <div id="lidar-scan">
    <div class="row row-1"></div>
    <div class="row row-2">
      <div class="declare">
        <p class="ellipsis">定点雷达</p>
      </div>
    </div>
    <div class="row row-3">
      <iframe id="iframe-lidar-scan" :src="src" frameborder="0"></iframe>
    </div>
  </div>
</template>

<script>
import { technovoLidarLogin } from "../../axios/api";

export default {
  data() {
    return {
      src: null
    };
  },
  methods: {
    initMounted() {
      technovoLidarLogin(res => {
        localStorage.setItem("Token", res.data.token);
        localStorage.setItem("customerCode", res.data["customerCode"]);
        this.src = "http://sjz.lcgufen.com/kczg/system/html/lidar-scan.html";
        let iframe = document.getElementById("iframe-lidar-scan");
        iframe.contentWindow.postMessage({
          data: res.data["customerCode"] + "/" + res.data.token
        });
      });
    }
  },
  mounted() {
    this.initMounted();
  }
};
</script>

<style lang="stylus" scoped>
#lidar-scan
    position relative
    width 100%
    height 100%

    > .row-1
        height 120px

    > .row-2
        height 59px
        padding 30px 0 30px 1435px

    > .row-3
        height 775px

        > iframe
            position relative
            width 100%
            height 100%
</style>
